From 592ce2b6fe6e3ca5d21e95a97691b19aff263006 Mon Sep 17 00:00:00 2001 From: robertl Date: Mon, 20 Feb 2006 21:59:19 +0000 Subject: [PATCH] A truckload of "zero value add" changes to quiesce warnings and play nicer with MSVC. --- gpsbabel/coldsync/pdb.c | 14 +++++++++----- gpsbabel/defs.h | 1 + gpsbabel/gtm.c | 4 ++-- gpsbabel/jeeps/gpsapp.c | 3 +-- gpsbabel/mingw/wintesto.cmd | 12 ++++++++++++ gpsbabel/msvc/README.msvc | 5 +++++ gpsbabel/nmea.c | 3 +-- gpsbabel/rgbcolors.c | 2 +- gpsbabel/unicsv.c | 4 ++-- 9 files changed, 34 insertions(+), 14 deletions(-) diff --git a/gpsbabel/coldsync/pdb.c b/gpsbabel/coldsync/pdb.c index a6979821e..27a35bef1 100644 --- a/gpsbabel/coldsync/pdb.c +++ b/gpsbabel/coldsync/pdb.c @@ -6,7 +6,7 @@ * You may distribute this file under the terms of the Artistic * License, as specified in the README file. * - * $Id: pdb.c,v 1.8 2005-10-13 22:08:01 robertl Exp $ + * $Id: pdb.c,v 1.9 2006-02-20 21:59:19 robertl Exp $ */ /* XXX - The way zero-length records are handled is a bit of a kludge. They * shouldn't normally exist, with the exception of expunged records. But, @@ -35,6 +35,10 @@ */ #if defined (__WIN32__) #include +#define lseek _lseek +#define write _write +#define read _read +#define close _close #else #include #endif @@ -1587,7 +1591,7 @@ pdb_LoadAppBlock(int fd, offset = lseek(fd, 0L, SEEK_CUR); /* Find out where we are */ if (offset != db->appinfo_offset) { - if (offset > db->appinfo_offset) + if (offset > (off_t) db->appinfo_offset) { /* Oops! We're in the wrong place */ fprintf(stderr, _("Warning: AppInfo block in \"%.*s\" " @@ -1700,7 +1704,7 @@ pdb_LoadSortBlock(int fd, offset = lseek(fd, 0L, SEEK_CUR); /* Find out where we are */ if (offset != db->sortinfo_offset) { - if (offset > db->sortinfo_offset) + if (offset > (off_t) db->sortinfo_offset) { /* Oops! We're in the wrong place */ fprintf(stderr, _("Warning: sort block in \"%.*s\" " @@ -1791,7 +1795,7 @@ pdb_LoadResources(int fd, /* Find out where we are now */ if (offset != rsrc->offset) { - if (offset > rsrc->offset) + if (offset > (off_t) rsrc->offset) { fprintf(stderr, _("Warning: resource %d in " "\"%.*s\" isn't where " @@ -1924,7 +1928,7 @@ pdb_LoadRecords(int fd, /* Find out where we are now */ if (offset != rec->offset) { - if (offset > rec->offset) + if (offset > (off_t) rec->offset) { fprintf(stderr, _("Warning: record %d in " "\"%.*s\" isn't where " diff --git a/gpsbabel/defs.h b/gpsbabel/defs.h index cce4daba4..0cce2d982 100644 --- a/gpsbabel/defs.h +++ b/gpsbabel/defs.h @@ -50,6 +50,7 @@ # define snprintf _snprintf # define vsnprintf _vsnprintf # define fileno _fileno +# define strdup _strdup #endif /* Turn off numeric conversion warning */ diff --git a/gpsbabel/gtm.c b/gpsbabel/gtm.c index d31570b68..459c5b863 100644 --- a/gpsbabel/gtm.c +++ b/gpsbabel/gtm.c @@ -19,6 +19,7 @@ */ #include "defs.h" +#include "jeeps/gpsmath.h" static FILE *fd, *ofd; static int indatum; @@ -215,7 +216,7 @@ fwrite_string(FILE *fd, const char *str) } } -static char * +void fwrite_fixedstring(FILE *fd, const char *str, int fieldlen) { int len = str ? strlen(str) : 0; @@ -437,7 +438,6 @@ void convert_datum(double *lat, double *lon) static void gtm_rd_init(const char *fname) { - char buf[256]; int version; char *name; fd = xfopen(fname, "rb", MYNAME); diff --git a/gpsbabel/jeeps/gpsapp.c b/gpsbabel/jeeps/gpsapp.c index 87c3387b4..b815edcae 100644 --- a/gpsbabel/jeeps/gpsapp.c +++ b/gpsbabel/jeeps/gpsapp.c @@ -185,7 +185,6 @@ static int32 GPS_A000(const char *port) GPS_PPacket rec; int16 version; int16 id; - char tstr[256]; if(!GPS_Serial_On(port, &fd)) return gps_errno; @@ -2026,7 +2025,7 @@ static void GPS_D109_Send(UC *data, GPS_PWay way, int32 *len, int protoid) GPS_Util_Put_Int(p,(int32)GPS_Math_Deg_To_Semi(way->lon)); p+=sizeof(int32); if (way->alt_is_unknown) { - GPS_Util_Put_Float(p,1.0e25); + GPS_Util_Put_Float(p,(const float) 1.0e25); } else { GPS_Util_Put_Float(p,way->alt); } diff --git a/gpsbabel/mingw/wintesto.cmd b/gpsbabel/mingw/wintesto.cmd index 2171ab234..bfad8ce21 100644 --- a/gpsbabel/mingw/wintesto.cmd +++ b/gpsbabel/mingw/wintesto.cmd @@ -112,6 +112,18 @@ DEL %TMPDIR%\gl.gpx %TMPDIR%\gpx.gpx @echo. CALL :COMPARE %TMPDIR%\gpx.gpx %TMPDIR%\gu.wpt +REM GTM +DEL %TMPDIR%\gl.gpx %TMPDIR%\gpx.gpx +@echo on +@echo Testing... +%PNAME% -i gtm -f reference\sample.gtm -o gpx -F %TMPDIR%\gtm1.gpx +%PNAME% -i gpx -f %TMPDIR%\gtm1.gpx -o gtm -F %TMPDIR%\gtm.gtm +%PNAME% -i gtm -f %TMPDIR%\gtm.gtm -o gpx -F %TMPDIR%\gtm2.gpx +@echo off +@echo. +CALL :COMPARE %TMPDIR%\gtm1.gpx %TMPDIR%\gtm2.gpx +CALL :COMPARE %TMPDIR%\gtm.gtm reference\sample.gtm + REM Magellan Mapsend DEL %TMPDIR%\mm.mapsend %TMPDIR%\mm.gps @echo on diff --git a/gpsbabel/msvc/README.msvc b/gpsbabel/msvc/README.msvc index 373e22a77..109648d1b 100644 --- a/gpsbabel/msvc/README.msvc +++ b/gpsbabel/msvc/README.msvc @@ -10,6 +10,11 @@ load the workspace and hit "build all.") If you load these files in to Visual Studio .NET, you may be asked to convert them to the new format; In that case, you should do so. +Note that the "Microsoft Platform SDK" is required in addition to +the actual compiler package. If you're using the Express editions, +you must also reconfigure MSVC to use that as described at: + http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/ + The "Expat" directory contains the import library and header file for the Expat DLL. This may or may not be the latest build of Expat; you might want to check http://expat.sourceforge.net to see if there is a more recent diff --git a/gpsbabel/nmea.c b/gpsbabel/nmea.c index 9346fbd67..8eda30488 100644 --- a/gpsbabel/nmea.c +++ b/gpsbabel/nmea.c @@ -571,8 +571,8 @@ nmea_fix_timestamps(route_head *track) } else { - queue *elem, *temp; time_t prev; + queue *elem; tm.tm_hour = 23; /* last date found */ tm.tm_min = 59; @@ -589,7 +589,6 @@ nmea_fix_timestamps(route_head *track) if (wpt->centiseconds != 0) { time_t dt; - struct tm time; wpt->centiseconds = 0; /* reset flag */ diff --git a/gpsbabel/rgbcolors.c b/gpsbabel/rgbcolors.c index b9589ed51..56d6727f9 100644 --- a/gpsbabel/rgbcolors.c +++ b/gpsbabel/rgbcolors.c @@ -244,5 +244,5 @@ color_to_bbggrr( char *opt_color ) } fatal( "unrecognized color name %s\n", opt_color ); - + return -1; } diff --git a/gpsbabel/unicsv.c b/gpsbabel/unicsv.c index d0a4b7d75..d72a844b2 100644 --- a/gpsbabel/unicsv.c +++ b/gpsbabel/unicsv.c @@ -39,7 +39,7 @@ struct { int urlcol; } unicsv_fieldpos; -static float unicsv_altscale; +static double unicsv_altscale; static char *unicsv_fieldsep; static @@ -183,7 +183,7 @@ unicsv_parse_one_line(char *ibuf) } static void -unicsv_rd() +unicsv_rd(void) { char buff[1024]; -- 2.30.2